
//
//  BKIntegralDetailHeaderView.m
//  bestkeep
//
//  Created by yons on 16/12/5.
//  Copyright © 2016年 utouu. All rights reserved.
//

#import "BKIntegralDetailHeaderView.h"
#import "BKMainCommon.h"

@interface BKIntegralDetailHeaderView()

@property(nonatomic,strong)UILabel *titleLabel;
@property(nonatomic,strong)UIImageView *iconImageView;


@end

@implementation BKIntegralDetailHeaderView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame: frame];
    if (self) {
        [self initViews];
    }
    return self;
}

-(void)initViews{
    UIView *backView = [UIView new];
    backView.backgroundColor = [UIColor whiteColor];
    [self addSubview:backView];
    [backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.mas_top);
        make.bottom.mas_equalTo(self.mas_bottom);
        make.left.mas_equalTo(self.mas_left);
        make.right.mas_equalTo(self.mas_right);
    }];
    
    _titleLabel = [UILabel new];
    _titleLabel.text = @"我的积分";
    _titleLabel.textColor = RGB(51, 51, 51);
    _titleLabel.textAlignment = NSTextAlignmentLeft;
    _titleLabel.font = [Common systemFontOfSize:15];
    [backView addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(backView.mas_left).offset(ApplicationBackGauge);
        make.centerY.mas_equalTo(backView.mas_centerY);
        make.height.mas_equalTo(@30);
    }];
    
    _iconImageView = [UIImageView new];
    _iconImageView.image = [Resources imageNamed:@"BKIntegral_jficon"];
    [backView addSubview:_iconImageView];
    [_iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(backView.mas_centerY);
        make.centerX.mas_equalTo(self.mas_centerX).mas_offset(-58/2.0);
        make.width.mas_equalTo(58/2);
        make.height.mas_equalTo(66/2);
    }];
    
    _numberLabel = [UILabel new];
    _numberLabel.textAlignment = NSTextAlignmentLeft;
    _numberLabel.text = @"...";
    _numberLabel.font = [Common systemFontOfSize:30];
    _numberLabel.textColor = RGB(51, 51, 51);
    
    [self addSubview:_numberLabel];
    [_numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(backView.mas_centerY);
        make.left.mas_equalTo(_iconImageView.mas_right).offset(10);
        make.height.mas_equalTo(@30);
    }];
    
}

@end
